<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:custom="http://faces.componete/jsf"
       xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">
    <link href="./css/default.css" rel="stylesheet" type="text/css" />
    
    <body>
        
        <ui:composition template="./Template.xhtml">
          <ui:param name="title" value="Consulta de Tipo de Cliente"/>
            <ui:define name="content">
                <h:form>
                    <fieldset class="camposCompleto">
                        <legend class="news">DADOS DA PESQUISA:</legend>
                        <table  align="center" border="0">
                            <tr>

                            </tr>
                            <td class="label">Nome:</td>
                            <td><h:inputText  value="#{TipoClienteBo.valConsulta}" styleClass="textFieldEscritas" id="Descricao" maxlength="50"/>  </td>
                            <tr>
                                <td>&nbsp;

                                </td>
                                <td>
                                    <h:commandButton accesskey="P" styleClass="button" value="Pesquisar" action="#{TipoClienteBo.consult_TipoCliente}" />&#160;&#160;
                                    <h:commandButton accesskey="L" styleClass="button" value="Limpar" action="#{TipoClienteBo.limparCons}"/>&#160;&#160;
                                    <h:commandButton accesskey="V" styleClass="button" value="Voltar" action="#{TipoClienteBo.addtipo}"/>&#160;&#160;
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                     <rich:dataTable value="#{TipoClienteBo.tipoClientesTo}" var="item" width="700px" rowClasses="classeOne,classTwo" columnClasses="center"
                                    rows="15" reRender="ds">
                        <f:facet name="header">
                            <h:outputText value="Lista Tipo de Cliente"/>
                        </f:facet>
                        <rich:column sortBy="#{item.codTipoCliente}">
                            <f:facet name="header">
                                <h:outputText value="Código Tipo Cliente"/>
                            </f:facet>
                            <h:outputText value="#{item.codTipoCliente}"/>
                        </rich:column>
                        <rich:column sortBy="#{item.descricaoReduzida}">
                            <f:facet name="header">
                                <h:outputText value="Tipo"/>
                            </f:facet>
                            <h:outputText value="#{item.descricaoReduzida}"/>
                        </rich:column>
                         <rich:column sortBy="#{item.descricao}">
                            <f:facet name="header">
                                <h:outputText value="Descrição"/>
                            </f:facet>
                            <h:outputText value="#{item.descricao}"/>
                        </rich:column>

                        <rich:column>
                            <f:facet name="header">
                                <h:outputText value="Ações"/>
                            </f:facet>
                            <h:commandButton value= "Alterar" accesskey="A" styleClass="button" action="#{TipoClienteBo.iniciaEditTipocliente}" >
                                <f:setPropertyActionListener target="#{TipoClienteBo.selectTipocliente}" value="#{item}"/>
                            </h:commandButton>

                        </rich:column>
                        <f:facet name="footer">
                            <rich:datascroller id="ds"></rich:datascroller>
                        </f:facet>
                    </rich:dataTable>

                </h:form>
            </ui:define>
        </ui:composition>
        
    </body>
</html>
